package com.hgl.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hgl.service.HglService;
import com.hgl.service.impl.HglServiceImpl;
@WebServlet("/admin/msg.let")
public class UserDeleteServlet extends HttpServlet{
	private HglService hglservice=new HglServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try{
		int hglId=Integer.valueOf(req.getParameter("hgl_id")) ;
		hglservice.deleteById(hglId);
		req.setAttribute("msg", "删除用户成功");
		req.setAttribute("href", "admin/news-list.let");
		}catch(Exception ex){
			req.setAttribute("error", ex);
	}
		req.getRequestDispatcher("/admin/msg.jsp").forward(req, resp);
	}

}
